package com.cloud.pages;

import org.openqa.selenium.By;
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;

public class RegisterPage extends AnyPage {


    //Constructor
    public RegisterPage(PageManager pages) {
        super(pages);
    }


    //Variables
    private String registerPageTitle = "Sign up - Swivl";


    //Methods
    public RegisterPage ensurePageLoaded() {
        wait.until(presenceOfElementLocated(By.xpath("//*[@id=\"formSubmit\"][text()='Register']")));
        return this;
    }

    public boolean isLoaded() {
        try {
            wait.until(presenceOfElementLocated(By.xpath("//*[@id=\"formSubmit\"][text()='Register']")));
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public String getRegisterPageTitle() {
        return registerPageTitle;
    }

}
